<?php include_once './application/views/sys_admin/common/header.php';  ?>

<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once './application/views/sys_admin/common/borrow_left.php';  ?>
	<?php 
	$borrow_status = array(
		0=>'所有',
		1=>'未审核',
		2=>'审核通过',
		3=>'已满标',
		4=>'已还完',
		5=>'取消',
	);
	
	$borrow_check = array(0=>'未检查',1=>'数据已检查');
	?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>贷款管理</strong> &gt;&gt;  易居宝  &gt;&gt;  审核
		</div>
		<div class="admin_borrow">
		<div class="admin_right_info_title"><h2>审标</h2></div>
			<iframe id="ifame" name="ifame" style="display:none"></iframe>
			<form action="/sys_admin/yjb/edit.html" method="post" target="ifame" id="yjbform" name="yjbform">
			<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC">
			  <tr>
				<td bgcolor="#FFFFFF">用户名：<?php echo $borrow['username'];?></td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">标题：<input type="text" name="title" value="<?php echo $borrow['title'];?>"/></td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">金额：<input type="text" name="account" value="<?php echo $borrow['account'];?>"/></td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">
				期限利率：<br />
				<?php 
				$aprList = json_decode($borrow['apr_list'],true);
				?>
				<?php foreach ($aprList as $val) {?>
					<?php if ($val['time_limit']==7){?>
					<input type="checkbox" name="time_limit[]" value="7" checked="checked"/>7天   利率：<input class="yzinput" type="text" id="apr7" name="apr7" value="<?php echo $val['apr'];?>" style="width:30px;"/>%<br />
					<?php }elseif ($val['time_limit']==15){?>
					<input type="checkbox" name="time_limit[]" value="15" checked="checked"/>15天  利率：<input class="yzinput" type="text" id="apr15" name="apr15" value="<?php echo $val['apr'];?>" style="width:30px;"/>%<br />
					<?php }elseif ($val['time_limit']==20){?>
					<input type="checkbox" name="time_limit[]" value="20" checked="checked"/>20天  利率：<input class="yzinput" type="text" id="apr20" name="apr20" value="<?php echo $val['apr'];?>" style="width:30px;"/>%<br />
					<?php }elseif ($val['time_limit']==30){?>
					<input type="checkbox" name="time_limit[]" value="30" checked="checked"/>30天  利率：<input class="yzinput" type="text" id="apr30" name="apr30" value="<?php echo $val['apr'];?>" style="width:30px;"/>%<br />
					<?php }?>
					
				<?php }?>
				</td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">还款方式：到期还本息</td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">最低投标金额：<input class="yzinput" type="text" id="lowest_account" name="lowest_account" value="<?php echo $borrow['lowest_account'];?>">元</td>
			  </tr>
			  <tr>
				<td bgcolor="#FFFFFF">最高投标金额：<input class="yzinput" type="text" id="most_account" name="most_account" value="<?php echo $borrow['most_account'];?>">元</td>
			  </tr>
			  <tr>
			  	<td bgcolor="#FFFFFF">每份金额：<input class="yzinput" type="text" id="one_account" name="one_account" value="<?php echo $borrow['one_account'];?>">元</td>
			  </tr>
              <tr>
				<td bgcolor="#FFFFFF">状态：<font style="color:blue"><?php echo $borrow_status[$borrow['fstatus']];?></font></td>
				</tr>
				<tr>
				<td bgcolor="#FFFFFF">数据是否检查：<font style="color:blue"><?php echo $borrow_check[$borrow['is_check']];?></font></td>
				</tr>
			  <tr>
				<td bgcolor="#FFFFFF">借款说明：
				<textarea name="content" id="content"><?php echo $borrow['content'];?></textarea>
				</td>
			  </tr>
			  <tr>
			  	<td  bgcolor="#FFFFFF">自动审核时间:
              		<input type="text" id="auto_verify_time" name="auto_verify_time" class="pubinput" style="width: 150px;" value="<?php echo date('Y-m-d H:i',$borrow['auto_verify_time']);?>"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly="readonly" />
              	</td>
			  </tr>
				
              <tr>
				<td bgcolor="#FFFFFF">状态：<input type="radio" name="fstatus" id="fstatus" value="<?php echo $borrow['fstatus'];?>" checked="checked" />暂不审核 <input type="radio" name="fstatus" id="fstatus" value="2" />审核通过 <input type="radio" name="fstatus" id="fstatus" value="5" />审核不通过 </td>
				</tr>
              <tr>
				<td bgcolor="#FFFFFF" style="padding:10px">备注：<textarea style="width:300px;height:50px;" id="verify_remark" name="verify_remark"></textarea></td>
				</tr>
			</table>
			<input type="hidden" name="id" value="<?php echo $borrow['id'];?>" />
			<div style="overflow:hidden;width:99%;margin:10px 0;text-align:center;"><input type="submit" value="提交" class="positive" />
			<?php if($borrow['is_check'] == 0){?>
				<input type="button" value="数据检查" class="positive" onclick="borrow_check()" />
			<?php }?>	
				
				</div>
			</form>
			</div>

<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>

<script>
function borrow_check(borrow_id){
	$.ajax({
		type: "post",
		url: "/sys_admin/yjb/borrow_yjb_check/",
		data:$("form").serialize(),
		success: function(msg){
			if(msg == 1){
				window.location.reload();
			}else{
				alert(msg);
			}
		},
		dataType: "text"
	});
	
}

</script>

</body>
</html>
